package cn.fintecher.pangolin.service.report.web;

import cn.fintecher.pangolin.common.web.BaseController;
import cn.fintecher.pangolin.service.report.response.PrincipalResponse;
import cn.fintecher.pangolin.service.report.response.StarUserResponse;
import cn.fintecher.pangolin.service.report.service.HomePageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xiaqun
 * @Description: 首页相关统计接口
 * @Date: 17:23 2019/12/12
 */

@RestController
@RequestMapping("/api/homePageController")
@Api(value = "首页相关统计接口", description = "首页相关统计接口")
public class HomePageController extends BaseController {
    @Autowired
    private HomePageService homePageService;

    /**
     * 委托方回款统计
     */
    @ApiOperation(value = "委托方回款统计", notes = "委托方回款统计")
    @GetMapping("/getPrincipal")
    public ResponseEntity<PrincipalResponse> getPrincipal() {
        log.info("REST request to get principal");
        PrincipalResponse response = homePageService.getPrincipal();
        return ResponseEntity.ok().body(response);
    }

    /**
     * 明星催收员统计
     */
    @ApiOperation(value = "明星催收员统计", notes = "明星催收员统计")
    @GetMapping("/getStarUser")
    public ResponseEntity<StarUserResponse> getStarUser() {
        log.info("REST request to get star user");
        StarUserResponse response = homePageService.getStarUser();
        return ResponseEntity.ok().body(response);
    }
}